//
//  MYShopDetailsSpecificationsSelectHeaderView.m
//  MuYing
//
//  Created by tbb on 2019/7/29.
//  Copyright © 2019 TBB. All rights reserved.
//

#import "MYShopDetailsSpecificationsSelectHeaderView.h"

@interface MYShopDetailsSpecificationsSelectHeaderView ()

@end

@implementation MYShopDetailsSpecificationsSelectHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = UIColor.whiteColor;
        [self addSubview:self.goodsIcon];
        [self.goodsIcon mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(12);
            make.top.mas_equalTo(25);
            make.size.mas_equalTo(CGSizeMake(78, 78));
        }];
        [self addSubview:self.priceLb];
        [self.priceLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(37);
            make.left.mas_equalTo(self.goodsIcon.mas_right).mas_equalTo(12);
            make.height.mas_equalTo(24);
        }];
        [self addSubview:self.inventoryLb];
        [self.inventoryLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.priceLb.mas_bottom).mas_equalTo(2);
            make.left.mas_equalTo(self.goodsIcon.mas_right).mas_equalTo(12);
            make.height.mas_equalTo(16);
        }];
        
        [self addSubview:self.specificationsLb];
        [self.specificationsLb mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.inventoryLb.mas_bottom).mas_equalTo(8);
            make.left.mas_equalTo(self.goodsIcon.mas_right).mas_equalTo(12);
            make.right.mas_equalTo(-15);
            make.height.mas_equalTo(16);
        }];
        
    }
    return self;
}

#pragma makr -- lazy
-(UIImageView *)goodsIcon {
    if (!_goodsIcon) {
        _goodsIcon = [[UIImageView alloc] init];
        _goodsIcon.backgroundColor = kAPPThemeColor;
        _goodsIcon.layer.cornerRadius = 6.0;
        _goodsIcon.clipsToBounds = true;
    }
    return _goodsIcon;
}
-(UILabel *)priceLb {
    if (!_priceLb) {
        _priceLb = [[UILabel alloc] init];
        _priceLb.font = kSystemMedium(17);
        _priceLb.textColor = HexColor(0x50A9B5);
        _priceLb.text = @"---";
    }
    return _priceLb;
}
-(UILabel *)inventoryLb {
    if (!_inventoryLb) {
        _inventoryLb = [[UILabel alloc] init];
        _inventoryLb.font = kSystemMedium(11);
        _inventoryLb.textColor = HexColor(0x989898);
        _inventoryLb.text = @"---";
    }
    return _inventoryLb;
}

-(UILabel *)specificationsLb {
    if (!_specificationsLb) {
        _specificationsLb = [[UILabel alloc] init];
        _specificationsLb.font = kSystemMedium(11);
        _specificationsLb.textColor = HexColor(0x656565);
        _specificationsLb.text = @"---";
    }
    return _specificationsLb;
}
#pragma makr -- lazy end
@end
